package think.in.spring.config;


import org.springframework.context.annotation.Bean;
import think.in.spring.bean.UserHolder;
import think.in.spring.ioc.overview.domain.User;

/**
 * 使用注解方式来配置UserHold
 */
public class SetterMethodDependencyInjectionConfig {

    @Bean
    public UserHolder userHolder(User user) {
        UserHolder userHolder = new UserHolder();
        userHolder.setUser(user);
        return userHolder;
    }
}
